const validator = {
  ip: [
    { type: "string", required: true },
    {
      pattern:
        /^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?):(\d{1,5})$/,
      message: "IP地址格式不正确",
    },
  ],
  code: [{ type: "string", required: true }],
  email: [
    { type: "string" },
    {
      pattern: /^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/,
      message: "邮箱格式不正确",
    },
  ],
  expire: [{ type: "number" }],
};

export default validator;
